package cn.shu.Strategy;

/**
 * 策略模式
 */
public class Test {

    public static void main(String[] args) {
        //1~~~~
        Context context = null;
        context = new Context(1);
        context.getLoc();
        context = new Context(2);
        context.getLoc();
        context = new Context(3);
        context.getLoc();

        //另外一种写法。双重策略模式
        Context.Machine.getStrategy(1).getLoc();
        Context.Machine.getStrategy(2).getLoc();
        Context.Machine.getStrategy(3).getLoc();

    }
}
